luke-jr | brolin_empey: ? | 06:59 |
---|---|---|
brolin_empey | luke-jr: ?? | 07:05 |
luke-jr | "my aforementioned floating point “problem”" | 07:05 |
luke-jr | what problem?> | 07:05 |
brolin_empey | The lack of rounding of the result of the prices I am adding, which should have only two decimal places. | 07:08 |
luke-jr | you should never use floats for money | 07:08 |
brolin_empey | Well, I use Python as a calculator on my desktop computer and it seems that Python uses floating point in this context. | 07:11 |
DocScrutinizer05 | luke-jr: brolin_empey: COBOL actually uses EBDIC (sort of BCD) dezimal digits to represent and compute values, more often than not that's money. they will know why the do this | 08:26 |
brolin_empey | Maybe I can have Python use fixed point instead of floating point? Or use something other than Python, such as bc? | 08:30 |
Maxdamantus | Python has `//` for integral division, if that's what you need. | 08:35 |
brolin_empey | Incidentally: Which interface is used to connect the integrated hardware keyboard on an ARM or MIPS handheld or notebook computer, such as the Nokia N900 or PineBook (both ARM) or Ben NanoNote (MIPS) or a computer not usually running Linux, such as the Nokia C6-00 (Symbian on ARM) or BlackBerry Classic (BlackBerry 10 on ARM)? On x86 notebook computers, the integrated keyboard and mouse substitute are usually connected via PS/2 but I do not know how the | 08:39 |
brolin_empey | integrated hardware keyboard and trackball or similar are connected on non-x86 computers other than Apple PowerBook m68k and PowerPC notebook computers, which use Apple Desktop Bus. | 08:39 |
Maxdamantus | N900 uses i2c afaik | 08:41 |
Maxdamantus | I imagine there isn't a standard interface for almost all keyboards. | 08:42 |
brolin_empey | Python: In this case, I am adding instead of dividing. | 08:59 |
Maxdamantus | If you add two ints in Python, you should get back an int. | 09:21 |
Maxdamantus | though iirc there is something liku .__iadd__, so maybe there's an operator for that too. | 09:21 |
Maxdamantus | maybe not | 09:21 |
Maxdamantus | anyway, the goal should be to not get a float in the first place, rather than to convert it to int when you get it. | 09:22 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!