StrF() and StrD() decimal places default change.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

StrF() and StrD() decimal places default change.

Post by Rescator »

Fred, any chance you could change the default for StrF() and StrD() to 7 and 15 decimal places respectively?
http://en.wikipedia.org/wiki/IEEE_float ... ic_formats
http://www.mathworks.com/help/techdoc/ref/format.html

The IEEE standards states that single float has 7.22 decimal precision and that double float has 15.95.
So therefore MATLAB rounds to 7 for singles and 15 for doubles. (If I recall correctly MySQL also does what MATLAB does.)
It kinda makes sense for the most common decimal places length to be the default.

Currently both StrF() and StrD() has a default of 10 decimal places.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: StrF() and StrD() decimal places default change.

Post by Little John »

Rescator wrote:Fred, any chance you could change the default for StrF() and StrD() to 7 and 15 decimal places respectively?
I agree.
It makes sense to return the maximum possible number of decimal places of the respective format by default -- but not more than the maximum possible number. :-)

Regards, Little John
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Re: StrF() and StrD() decimal places default change.

Post by kenmo »

A good, sensible request.
Post Reply