Skip to content

Divide by zero allowed? #182

@mankoff

Description

@mankoff

I'm getting the following error:

Thread 1 "r01.exe" received signal SIGFPE, Arithmetic exception.
0x00007ffff7b58b12 in blitz::Divide<double, double>::apply (a=1, b=0) at /home/kdm/projects/GISS/LIME/opt/include/blitz/ops.h:147
147	BZ_DEFINE_BINARY_OP(Divide,/)

From this line:

blitz::Array<double,1> sIpvXOp(1. / IpvXOp->wM);

Is there a flag I can set to allow divide-by-zero to return NaNs rather than SIGFPE? I've compiled Blitz with

CFLAGS="-fPIC" \
 FCFLAGS="-fPIC -DNDEBUG" \
 CPPFLAGS="-fPIC -DNDEBUG" \
 cmake .. \
  -D CMAKE_INSTALL_PREFIX=${LIME_ROOT}/opt \
  -D CMAKE_INSTALL_LIBDIR=${LIME_ROOT}/opt/lib \
  -D Python_EXECUTABLE=${MAMBA_ENV}/lime/bin/python

make -j
make install

(original issue at NASA-GISS/LIME#1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions