Python Forum
Python 3- binary math is stupid
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3- binary math is stupid
#1
One of these things doesn't do math like the other. (Python 3.5.5)

>>> import numpy as np
>>> np.arange(35.5,29.5,-0.1)
array([35.5, 35.4, 35.3, 35.2, 35.1, 35. , 34.9, 34.8, 34.7, 34.6, 34.5,
       34.4, 34.3, 34.2, 34.1, 34. , 33.9, 33.8, 33.7, 33.6, 33.5, 33.4,
       33.3, 33.2, 33.1, 33. , 32.9, 32.8, 32.7, 32.6, 32.5, 32.4, 32.3,
       32.2, 32.1, 32. , 31.9, 31.8, 31.7, 31.6, 31.5, 31.4, 31.3, 31.2,
       31.1, 31. , 30.9, 30.8, 30.7, 30.6, 30.5, 30.4, 30.3, 30.2, 30.1,
       30. , 29.9, 29.8, 29.7, 29.6)
>>> np.arange(35.5,29.4,-0.1)
array([35.5, 35.4, 35.3, 35.2, 35.1, 35. , 34.9, 34.8, 34.7, 34.6, 34.5,
       34.4, 34.3, 34.2, 34.1, 34. , 33.9, 33.8, 33.7, 33.6, 33.5, 33.4,
       33.3, 33.2, 33.1, 33. , 32.9, 32.8, 32.7, 32.6, 32.5, 32.4, 32.3,
       32.2, 32.1, 32. , 31.9, 31.8, 31.7, 31.6, 31.5, 31.4, 31.3, 31.2,
       31.1, 31. , 30.9, 30.8, 30.7, 30.6, 30.5, 30.4, 30.3, 30.2, 30.1,
       30. , 29.9, 29.8, 29.7, 29.6, 29.5, 29.4])
>>> np.arange(355.0,294.0,-1)/10
array([35.5, 35.4, 35.3, 35.2, 35.1, 35. , 34.9, 34.8, 34.7, 34.6, 34.5,
       34.4, 34.3, 34.2, 34.1, 34. , 33.9, 33.8, 33.7, 33.6, 33.5, 33.4,
       33.3, 33.2, 33.1, 33. , 32.9, 32.8, 32.7, 32.6, 32.5, 32.4, 32.3,
       32.2, 32.1, 32. , 31.9, 31.8, 31.7, 31.6, 31.5, 31.4, 31.3, 31.2,
       31.1, 31. , 30.9, 30.8, 30.7, 30.6, 30.5, 30.4, 30.3, 30.2, 30.1,
       30. , 29.9, 29.8, 29.7, 29.6, 29.5])
Reply


Messages In This Thread
Python 3- binary math is stupid - by FlyingGaijin - Jun-29-2018, 04:56 PM
RE: Python 3- binary math is stupid - by ichabod801 - Jun-29-2018, 07:28 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020