Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Value: why not float support?
Re: Value: why not float support? [message #28417 is a reply to message #28401] Wed, 01 September 2010 13:52 Go to previous messageGo to previous message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
Quote:

Are you aware that C/C++ always performs all FP arithmetics in double precision by standard definition?


As far as I can see this is not true. The C++ standard incorporates part of the ISO C standard by reference, including 5.2.4.2.2 where this is specified. I don't have the C90 standard but the C99 standard specifies that FLT_EVAL_METHOD IN float.h (cfloat in C++) has value zero if the calculation precision is the same as the operand precision and value 1 if the calculation precision is double. FLT_EVAL_METHOD wasn't part of C90 but it's very unlikely that C90 required double precision and C99 doesn't.

Also, double is required to have at least 10 significant decimal digits (DBL_DIG in cfloat) and floats at least 6 digits(FLT_DIG).

Graeme
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Core/Path.cpp: the limitation of GetCurrentDirectory for POSIX
Next Topic: InitCaps() proposal
Goto Forum:
  


Current Time: Mon Aug 25 18:04:50 CEST 2025

Total time taken to generate the page: 0.06320 seconds