Re: How to Define High-precision Date type



In article <1143783871.851671.134250@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Donkey <newsdonkey@xxxxxxxxxxx> wrote:
The precision of built-in date type of C is very low. Even using long
double float type or double float type, we can only use 12 or 16 digits
after the decimal point. What can we do if we want to use
high-precision number such as the number with 50 digits after the
decimal point. Can we define a user date type?

No, if you want longer precision that is provided by the compiler,
then you either have to program the calculation routines yourself,
or else find a pre-written extended precision library and use it.

--
Programming is what happens while you're busy making other plans.
.



Relevant Pages

  • Re: This calculation is just wrong / computer cant count!
    ... Think of the float type like you would a ... it is as correct as it can be given the amount of storage ... I expected the C++ basic data types to be able to handle simple maths ... Clearly it can only store digits to a certain number binary ...
    (microsoft.public.vc.mfc)
  • Re: How to Define High-precision Date type
    ... double float type or double float type, we can only use 12 or 16 digits ... The place that greater precision becomes meaningful is in intermendiate results in some arithmetic operations. ...
    (comp.lang.c)
  • [OT] Re: right truncate of float variable
    ... Keith Thompson wrote: ... >>Sorry back ground is that I will be always getting a number of float type, ... nerdy kids dared each other to recite the digits of pi. ... Prev by Date: ...
    (comp.lang.c)
  • Re: How to Define High-precision Date type
    ... Donkey wrote: ... double float type or double float type, we can only use 12 or 16 ... digits after the decimal point. ... high-precision number such as the number with 50 digits after the ...
    (comp.lang.c)
  • Re: How to Define High-precision Date type
    ... double float type or double float type, we can only use 12 or 16 digits ... Use a library such as GNU GMP (google it). ... Keith Thompson kst-u@xxxxxxx ...
    (comp.lang.c)