[fitsbits] Output array type when BZERO is an integer {External}

Maren Purves m.purves at eaobservatory.org
Tue Mar 12 22:50:16 EDT 2024


Good thing that is going away.
Our default python is still python2 - mostly because we're short-staffed.

Maren

On Tue, Mar 12, 2024 at 1:27 PM John Parejko <parejkoj at uw.edu> wrote:
>
> On Mar 12, 2024, at 15:53, Maren Purves via fitsbits <fitsbits at listmgr.nrao.edu> wrote:
>
> > As somebody who 'grew' up' with "IMPLICIT
> > NONE" this occasionally still catches me when using python as a
> > command line calculator because it doesn't convert to floating point
> > in the division of numbers that don't have decimal points.
>
> For the record, that was true in python2, but is not true in python3. In python3, if you want pure integer division, you have to use `//`:
>
> Python 3.11.7 | packaged by conda-forge | (main, Dec 23 2023, 14:38:07) [Clang 16.0.6 ] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 2/3
> 0.6666666666666666
> >>> 2//3
> 0
>
> John
>
>



More information about the fitsbits mailing list