User Tools

Site Tools


rules_about_number_arguments

Rules about number arguments

When a function is expecting a <number> argument, the following baseline rules will apply unless the function documents different behavior:

* A missing argument causes the function to fail and return the empty string. The function will not have performed any action.
* Integer arguments are converted using strtoimax(3).
* Float arguments are converted using atof(3).
* Integer return values are generated with ltoa() [which is builtin to the client].
* Float return values are generated with “%.50g”
* “nan” is usually returned if a floating point operationg resulted in an NaN.
* “DOM” is returned if a floating point operation resulted in an EDOM error
* “RANGE” is returned if a floating point operation resulted in an ERANGE error

rules_about_number_arguments.txt · Last modified: 2010/05/12 22:19 (external edit)