gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15109] Size of dataset as an Arithmetic operator


From: Mohammad Akhlaghi
Subject: [task #15109] Size of dataset as an Arithmetic operator
Date: Thu, 5 Mar 2020 20:19:10 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #8, task #15109 (project gnuastro):

Looks good! You are on the right track :-)!

About reading the contents of the `arg' argument, you can look at a few other
functions in that file for examples. For example see `arithmetic_bitwise_not'
which does bitwise operations on its input. But its input must be an integer
type, so before it starts, it first checks if the `type' element of the
`gal_data_t' structure has a floating point type or not. In your case, you
also want it to be an integer, so you can add a similar test. But besides it
type, you also want it to be a single number. If the user mistakenly gives an
array/image as the first argument, your function should crash with a clear
error message, like the other functions in `lib/arithmetic.c'.

About the crash with an unrecognized operator, I would recommend to follow the
functions from the again. You will find the place that you still haven't added
the new operator. I'll let you find it as an exersize ;-). TIP: you can use
`grep' with the fixed parts of the error message to find it.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15109>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]