473,783 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Define High-precision Date type

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?

Mar 31 '06
15 4001
stathis gotsis wrote:
"Mark McIntyre" <ma**********@s pamcop.net> wrote in message
news:io******** *************** *********@4ax.c om...
On Fri, 31 Mar 2006 22:55:53 GMT, in comp.lang.c , Martin Ambuhl
<ma*****@earthl ink.net> wrote:
Mark McIntyre wrote:
Consider that the
relative error for G, the Newtonian gravitational constant, is 1.5e-4 in
the 2002 CODATA values.

This is a /physically observed/ constant. Its by definition not
accurate.


Well, many physical constants are meausred through experiments. I think the
relatively low accuracy in the measurement of the gravitational constant is
due to the fact that gravitational forces are rather weak.
Astronomy is an extremely poorly chosen example
for your purposes.

Apparently you're not an astronomer.
Nonsense. No sane person is using floating point types for finance, in
the first place. Such a person will be fired before the day is out,
anyway, so the number of significant digits is irrelevant.

Go tell that to the thousands of people using it every single day in
the City, New York .Tokyo, Frankfurt. etc.

Sorry, but you really have absolutely no idea what you're talking
about. I've worked in the City for 15 years now, and I do.


I apologize for my ignorance: City==London?


Not exactly. The City is part of London, where the banks are. Piccadilly
and Hyde Park are also parts of London but are not The City.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Apr 2 '06 #11
On Sun, 2 Apr 2006 03:31:21 +0300, in comp.lang.c , "stathis gotsis"
<st***********@ hotmail.com> wrote:
about. I've worked in the City for 15 years now, and I do.


I apologize for my ignorance: City==London?


Yes, the City of London is the actual name of the borough that
comprises the central part of London. It contains the financial and
commerce district, barring a few weirdos who've moved to Docklands.

http://www.cityoflondon.gov.uk/Corpo...undary_map.htm

Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 2 '06 #12
Joe Wright <jo********@com cast.net> wrote:
stathis gotsis wrote:
"Mark McIntyre" <ma**********@s pamcop.net> wrote in message
news:io******** *************** *********@4ax.c om...
On Fri, 31 Mar 2006 22:55:53 GMT, in comp.lang.c , Martin Ambuhl
<ma*****@earthl ink.net> wrote:

Nonsense. No sane person is using floating point types for finance, in
the first place. Such a person will be fired before the day is out,
anyway, so the number of significant digits is irrelevant.
Go tell that to the thousands of people using it every single day in
the City, New York .Tokyo, Frankfurt. etc.

Sorry, but you really have absolutely no idea what you're talking
about. I've worked in the City for 15 years now, and I do.

He said _sane_ people. Given the position of economy on the scientific
ladder (basically that of an amputated walrus trying desperately to
climb up, but too stupid and ungainly to find the first rung), it
shouldn't surprise anyone that major financial centres run on what is
basically guesswork. Scare, perhaps, but not surprise.
I apologize for my ignorance: City==London?


Not exactly. The City is part of London, where the banks are. Piccadilly
and Hyde Park are also parts of London but are not The City.


Not officially. The City is London, also known as the Square Mile (which
is more or less accurate). Piccadilly is Westminster, and so is Hyde
Park. What you're thinking of is Greater London.

Richard
Apr 3 '06 #13
On Mon, 03 Apr 2006 07:00:23 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
He said _sane_ people.
Sorry, I missed that bit. The wall sign was actually invented by us
city types I think. :-)
shouldn't surprise anyone that major financial centres run on what is
basically guesswork.
Options pricing, anyone?
Scare, perhaps, but not surprise.


And most of it runs on Windows desktops.....
you can run, but you cant' hide...
> I apologize for my ignorance: City==London?


Not exactly. The City is part of London, where the banks are. Piccadilly
and Hyde Park are also parts of London but are not The City.


Not officially. The City is London, also known as the Square Mile (which
is more or less accurate). Piccadilly is Westminster, and so is Hyde
Park. What you're thinking of is Greater London.


Yer all wrong. The City Of London is an entire city all of its own,
surrounded by more plebeian regions such as Islington, Westminster,
Southwark etc....
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 3 '06 #14
Mark McIntyre <ma**********@s pamcop.net> wrote:
On Mon, 03 Apr 2006 07:00:23 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
> I apologize for my ignorance: City==London?

Not exactly. The City is part of London, where the banks are. Piccadilly
and Hyde Park are also parts of London but are not The City.


Not officially. The City is London, also known as the Square Mile (which
is more or less accurate). Piccadilly is Westminster, and so is Hyde
Park. What you're thinking of is Greater London.


Yer all wrong. The City Of London is an entire city all of its own,
surrounded by more plebeian regions such as Islington, Westminster,
Southwark etc....


That's what I said, innit? Although I wouldn't describe Westmonasterium
as plebeian. Upstart, perhaps.

Of course, all poor saps who _work_ in the City actually come from the
borough to the North-East...

Richard
Apr 4 '06 #15
REH

Martin Ambuhl wrote:
When 15 significant
decimal digits allows expressing the average distance from the sun to
the earth to with 0.15 mm, that is high accuracy, indeed.


Just a nit:

I believe you mean high precision, not accuracy. One could say the
distance from the earth to the sun is 0.123456789 meters which is
(relatively) very precise, but not accurate.

REH

Apr 4 '06 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
2836
by: Dead RAM | last post by:
Hey people, i'll try to keep this short ;) Here is what I want to type (or at least close too)... #define VER_BUILD 1 #define STR_VER_BUILD "VER_BUILD" But what happends is the preprocessor see the quots in STR_VER_BUILD and replaces that text with "VER_BUILD"... I need it to see the VER_BUILD and replace it with 1, and only after doing
11
3655
by: Jürgen Hochwald | last post by:
Hi Maybe this is a simple question, but I don't know how to solve. Background: A weather station connected to the serial port sends data packets. This data packets are containing variables fom one byte up to 4 byted in mixed order. Now I want to define a structure to overlay it with UNION over the receive buffer for easily access to the single values in the data packet. The problem is, that I cannot defind a variable, which only...
31
3742
by: bilbothebagginsbab5 AT freenet DOT de | last post by:
Hello, hello. So. I've read what I could find on google(groups) for this, also the faq of comp.lang.c. But still I do not understand why there is not standard method to "(...) query the malloc package to find out how big an allocated block is". ( Question 7.27) Is there somwhere explained why - because it would seem to me, that free()
16
4379
by: msnews.microsoft.com | last post by:
I am teaching C# to my 11 year old child. One challenge is that all the C# books I own and that I have seen in bookstores are full of language that is not easily comprehended by a student at that age. Can anyone recommend books (or perhaps websites) tuned for younger audiences? BTW, its amazing how fast a student can absorb this kind of information at that age. Lucky them! Thanks, Bruce
2
1269
by: #define中的问题 | last post by:
#define RGB(r,g,b)((COLORREF)((BYTE)(r)| \ ((WORD)((BYTE)(g))<<8))| \ ((DWORD)(BYTE)(b))<<16))) what is the "| \" mean above? who give me a answer? Thank you very mauch!
2
2781
by: Jarod | last post by:
Hello I am curious how should I use the array of doubles. The problem is I don't know in advance how much elements would it have, but I can be sure it will be less then let's say 150 or 500. So should I define the largest one or use an arraylist ? I don't resize it, because after a few calculation the application will be closed. It works like that : read the file, make calculations, save the file , close. I could count the rows in a file...
3
8799
by: Lighter | last post by:
Why does Platform SDK define union LARGE_INTEGER in such a way? ntdef.h defines the union LARGE_INTEGER as follows: typedef union _LARGE_INTEGER { struct { ULONG LowPart;
40
18111
by: Chandresh | last post by:
Hi All, I am a graduate student in EE. I have a question that might seem unusual but in my opinion it is interesting and I request all experts to reply. Being a grad student, I came along many programming languages like Assembly, C, C++, VHDL, Matlab, Perl etc. and I dont remember how I learned them. I am more comfortable with Assembly programming than others. The question is how do you measure proficiency in C and C++ ? It is important...
6
27887
by: anirbid.banerjee | last post by:
Hi, I need to write a macro which would have a lot many conditional #ifdef ... #endif blocks in it. #define _xx_macro (x) { ... \ ... \ /* some code (); */ #ifdef _SOME_STMT \ ... \ ... \
8
26779
by: =?Utf-8?B?dGFuaQ==?= | last post by:
Hello there, one of my servers is running windows 2003 and IIS 6.0. We have big performance issues on that server and I found out that a high CPU usage iniciated by w3wp.exe causes the problem. I couldn't find out what to do on the server itself. I think it must be the application runnig on IIS. Could a MVP please confirm that this is mostly something that i caused by an application. So that I can give it back to our developers. Thanks
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.