Correcting solution to the 'round away from 0' exercise
This commit is contained in:
parent
429db566ac
commit
9e6559e6eb
@ -585,7 +585,7 @@
|
||||
"# Author: Charles R Harris\n",
|
||||
"\n",
|
||||
"Z = np.random.uniform(-10,+10,10)\n",
|
||||
"print (np.trunc(Z + np.copysign(0.5, Z)))"
|
||||
"print (np.copysign(np.ceil(np.abs(Z)), Z))"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -260,7 +260,7 @@ print(np.array([np.nan]).astype(int).astype(float))
|
||||
# Author: Charles R Harris
|
||||
|
||||
Z = np.random.uniform(-10,+10,10)
|
||||
print (np.trunc(Z + np.copysign(0.5, Z)))
|
||||
print (np.copysign(np.ceil(np.abs(Z)), Z))
|
||||
```
|
||||
|
||||
#### 30. How to find common values between two arrays? (★☆☆)
|
||||
|
Loading…
Reference in New Issue
Block a user