Lines Matching refs:val
23 static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next);
29 unsigned int sp_svg_number_read_f(gchar const *str, float *val)
41 *val = v;
45 unsigned int sp_svg_number_read_d(gchar const *str, double *val)
57 *val = v;
63 static unsigned int sp_svg_number_write_ui(gchar *buf, unsigned int val)
68 c[16u - (++i)] = '0' + (val % 10u);
69 val /= 10u;
70 } while (val > 0u);
80 static unsigned int sp_svg_number_write_i(gchar *buf, int bufLen, int val)
84 if (val < 0) {
86 uval = (unsigned int)-val;
88 uval = (unsigned int)val;
98 static unsigned sp_svg_number_write_d(gchar *buf, int bufLen, double val, unsigned int tprec, unsigned int fprec)
102 if (val < 0.0) {
104 val = fabs(val);
109 if (val >= 1.0) {
110 idigits = (int) floor(log10(val)) + 1;
116 val += 0.5 / pow(10.0, fprec);
118 double dival = floor(val);
119 double fval = val - dival;
149 unsigned int sp_svg_number_write_de(gchar *buf, int bufLen, double val, unsigned int tprec, int min_exp)
151 int eval = (int)floor(log10(fabs(val)));
152 if (val == 0.0 || eval < min_exp) {
161 return sp_svg_number_write_d(buf, bufLen, val, tprec, 0);
163 val = eval < 0 ? val * pow(10.0, -eval) : val / pow(10.0, eval);
164 int p = sp_svg_number_write_d(buf, bufLen, val, tprec, 0);
291 static unsigned sp_svg_length_read_lff(gchar const *str, SVGLength::Unit *unit, float *val, float *computed, char **next)
312 if (val) {
313 *val = v;
332 if (val) {
333 *val = v * 0.01;
349 if (val) {
350 *val = v;
429 if (val) {
430 *val = v;