Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
5bceb502
Commit
5bceb502
authored
May 24, 2018
by
Pranay Gupta
Browse files
float specifier defined to align floating point numbers while printing
parent
5b6630d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/d_misc.c
View file @
5bceb502
...
...
@@ -9,6 +9,13 @@
#include <stdio.h>
#include <string.h>
// an attempt to align floating point numbers in columns
#if PD_FLOATSIZE == 32
#define FLOAT_SPECIFIER "%#-.6g \t"
#elif PD_FLOATSIZE == 64
#define FLOAT_SPECIFIER "%#-.9lg \t"
#endif
/* ------------------------- print~ -------------------------- */
static
t_class
*
print_class
;
...
...
@@ -30,8 +37,8 @@ static t_int *print_perform(t_int *w)
int
i
=
0
;
startpost
(
"%s:"
,
x
->
x_sym
->
s_name
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
if
(
i
%
8
==
0
)
endpost
();
startpost
(
"%-8.5g"
,
in
[
i
]);
if
(
i
%
4
==
0
)
endpost
();
startpost
(
FLOAT_SPECIFIER
,
in
[
i
]);
}
endpost
();
x
->
x_count
--
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment