473,434 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

Casting Out nines, This one didn't work

Greetings from a puzzled, person who has used Casting Out Nines for
years.
$4338.94 - $4413.70 = $74.76.
4 - 1 = 3
$74.76 7+4+7+6 = 6 casting out nines. This is the only time
I have seen this

Would someone e-mail me as to why it doesn't work this time

Rod Edington
Et**********@sbcglobal.net

Nov 15 '05 #1
3 1688
Holistic wrote:
Greetings from a puzzled, person who has used Casting Out Nines for
years.
$4338.94 - $4413.70 = $74.76.
4 - 1 = 3
$74.76 7+4+7+6 = 6 casting out nines. This is the only time
I have seen this

Would someone e-mail me as to why it doesn't work this time


This has absolutely nothing to do with the C programming language.

That said, 4338.94 - 4413.70 equals -74.76, not 74.76. -6 + 9 = 3.

I'd invest in a calculator, which doesn't care if you know what you're
doing, and gives correct results without the need for checksums.

S.
Nov 15 '05 #2
On 6 Nov 2005 09:54:09 -0800, "Holistic" <et**********@sbcglobal.net>
wrote:
Greetings from a puzzled, person who has used Casting Out Nines for
years.
$4338.94 - $4413.70 = $74.76.
4 - 1 = 3
$74.76 7+4+7+6 = 6 casting out nines. This is the only time
I have seen this


obviously the result is -74.76 (note the *MINUS*)

Casting out 9s:
-7 + -4 + -7 + -6 = -24, adding 27 (3*9) will give the correct
result: 3, everything's alright!

-1 is equivalent to: 8! (not 1)
-2 is equivalent to: 7! (not 2)
....
Nov 15 '05 #3
Holistic made a completely off-topic post to comp.lang.c, including this
line:
Would someone e-mail me as to why it doesn't work this time This is ill-advised and rude as well, even when your post is topical.
Greetings from a puzzled, person who has used Casting Out Nines for
years.
$4338.94 - $4413.70 = $74.76.


No, it isn't. Learn simple arithmetic.
Nov 15 '05 #4

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

Similar topics

10
by: Michael R. Copeland | last post by:
How do I cast or promote a char variable to a char* variable? For example, I want to use strcat to append a character to an existing "string". (BTW, I'm not able to use STL string or CString data...
231
by: Brian Blais | last post by:
Hello, I saw on a couple of recent posts people saying that casting the return value of malloc is bad, like: d=(double *) malloc(50*sizeof(double)); why is this bad? I had always thought...
3
by: Kurt | last post by:
i just can't figure out why something im doing is not working correctly.... public interface IInterface { int someProperty { get; set; }
0
by: Kurt Lange | last post by:
no... the array is created dynamically. and no... that defeats the purpose of what im trying todo.. encapsulate all initializing of variables in base class... derive from it... by deriving...
23
by: René Nordby | last post by:
Hi there, Is there anyone that knows how to do the following? I have a class A and a class B, that 100% inherits from class A (this means that I don't have other code in class B, than...
8
by: wkaras | last post by:
In my compiler, the following code generates an error: union U { int i; double d; }; U u; int *ip = &u.i; U *up = static_cast<U *>(ip); // error I have to change the cast to...
8
by: Gamma | last post by:
I'm trying to inherit subclass from System.Diagnostics.Process, but whenever I cast a "Process" object to it's subclass, I encounter an exception "System.InvalidCastException" ("Specified cast is...
5
by: Thorsten | last post by:
Hi everyone, I am rather new to C# and have a problem that will probably seem trivial to most of you... but I hope you can still help me nevertheless.. Via the comport, I read the result of a...
29
by: Tony Johansson | last post by:
Hello! Here I have two different way to use casting. Is any of these any better then the other? Or is it just a question of taste. newCards.Add((Card)sourceCard.Clone());...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.