Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Trust the World's Fastest VPN with Your Internet Security & Freedom - A Lifetime Subscription of PureVPN at 88% off. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. ×

Comment Re:Things I Hate (Score 1) 523

From the History section on https://en.wikipedia.org/wiki/...

Chuck Weiss explains why he created DUAL:

I created the DUAL table as an underlying object in the Oracle Data Dictionary. It was never meant to be seen itself, but instead used inside a view that was expected to be queried. The idea was that you could do a JOIN to the DUAL table and create two rows in the result for every one row in your table. Then, by using GROUP BY, the resulting join could be summarized to show the amount of storage for the DATA extent and for the INDEX extent(s). The name, DUAL, apt for the process of creating a pair of rows from just one.[1]

The original DUAL table had two rows in it (hence its name), but subsequently it only had one row.

Comment Re:Lessons (Score 1) 497

If one is careful about rounding at the right time, one can live with Double for smaller amounts.

It's fine for a small amount, e.g. zero.

The next smallest amount 0.01 can not be held exactly in a Double. Nor can 0.1


(or for any figures which need to be stored exactly)

Multiply everything up by the required factors of 10 and store the value as an integer, e.g. a number of cents.

Or write your own decimal class, maybe with an integer to hold the dollars and another for the cents (and another for the tenths or hundredths if you need them).

Slashdot Top Deals