Re: How to Define High-precision Date type
- From: jacob navia <jacob@xxxxxxxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 08:39:35 +0200
Donkey a écrit :
Hi,
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?
The lcc-win32 compiler offers the qfloat data type with 103 digits precision and 350 bits
#include <stdio.h>
#include <qfloat.h>
int main(void)
{
qfloat s = sinq(1.0q);
printf("%118.109qf\n",s);
}
Output:
0.841470984807896506652502321630298999622563060798371065672751709991910404391239668948639743543052695854349
.
- References:
- How to Define High-precision Date type
- From: Donkey
- How to Define High-precision Date type
- Prev by Date: Re: Convert Java <long> to C <?>
- Next by Date: Re: How to Define High-precision Date type
- Previous by thread: Re: How to Define High-precision Date type
- Next by thread: Re: How to Define High-precision Date type
- Index(es):
Relevant Pages
|