Math::GSL::Errno(3pm)

πŸ’– NAME πŸ’–

Math::GSL::Errno β€” Error Handling, bestie. That's the Math::GSL::Errno(3pm) page you're on right now, and it's literally the module that catches all the "bestie something went wrong 😭" moments in GSL. πŸ’…


✨ SYNOPSIS ✨

use Math::GSL::Errno qw/:all/;
gsl_set_error_handler_off();

print gsl_strerror($GSL_EDOM) . "\n";

like, that's it. that's the whole vibe. pull in everything, turn the handler off, print the tea about your error code. 🫢


🚨 STATUS CODES 🚨

okay so these are all the little status codes GSL hands you when things happen. some are "slay we're fine", most are "we have a problem". read carefully, no skimming πŸ™ˆ

  • $GSL_SUCCESS β€” Success. we ate. πŸ’–
  • $GSL_FAILURE β€” General Failure. not specific, just vibes of doom.
  • $GSL_CONTINUE β€” Iteration has not converged. girl it's still going, don't touch anything.
  • $GSL_EDOM β€” Domain error; used by mathematical functions when an argument value does not fall into the domain over which the function is defined (like EDOM in the C library). bestie you handed it a number from outside the function's whole universe.
  • $GSL_ERANGE β€” Range error; used by mathematical functions when the result value is not representable because of overflow or underflow (like ERANGE in the C library). the answer exists, it just doesn't fit in the box.
  • $GSL_EFAULT β€” Invalid Pointer. πŸ‘»
  • $GSL_EINVAL β€” Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library). Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (like EINVAL in the C library). (yes the source says it twice, i'm not editing her, she's iconic like that πŸ’€)
  • $GSL_EFAILED β€” Generic Failure.
  • $GSL_EFACTOR β€” Factorization Failed.
  • $GSL_ESANITY β€” Sanity Check Failed. not beating the insanity allegations.
  • $GSL_ENOMEM β€” No memory available. The system cannot allocate more virtual memory because its capacity is full (like ENOMEM in the C library). This error is reported when a GSL routine encounters problems when trying to allocate memory with malloc.
  • $GSL_EBADFUNC β€” Problem with user-supplied function. that's on you, no shade, just facts.
  • $GSL_ERUNAWAY β€” Iterative process is our of control. (her typo, not mine β€” keeping it exactly ✨)
  • $GSL_EMAXITER β€” Exceeded max number of iterations.
  • $GSL_EZERODIV β€” Division by zero.
  • $GSL_EBADTOL β€” Invalid user-specified tolerance.
  • $GSL_ETOL β€” Failed to reach the specified tolerance.
  • $GSL_EUNDRFLW β€” Underflow.
  • $GSL_EOVRFLW β€” Overflow.
  • $GSL_ELOSS β€” Loss of accuracy.
  • $GSL_EROUND β€” Failed due to roundoff error.
  • $GSL_EBADLEN β€” Matrix/vector lengths not compatible. they're not compatible bestie, it's giving situationship.
  • $GSL_ENOTSQR β€” Not a square matrix.
  • $GSL_ESING β€” Singularity Detected. πŸ”₯
  • $GSL_EDIVERGE β€” Integral/Series is divergent.
  • $GSL_EUNSUP β€” Not supported by hardware.
  • $GSL_EUNIMPL β€” Not implemented.
  • $GSL_ECACHE β€” Cache limit exceeded.
  • $GSL_ETABLE β€” Table limit exceeded.
  • $GSL_ENOPROG β€” Iteration not converging.
  • $GSL_ENOPROGJ β€” Jacobian not improving solution.
  • $GSL_ETOLF β€” Cannot reach tolerance in F.
  • $GSL_ETOLX β€” Cannot reach tolerance in X.
  • $GSL_ETOLG β€” Cannot reach tolerance in Gradient.
  • $GSL_EOF β€” End of file. we've reached the end, periodt.

πŸ”§ FUNCTIONS πŸ”§

the whole roster, bestie, nobody gets left out:

  • gsl_error β€” listed here, no description in the original. mysterious queen. πŸ’…
  • gsl_stream_printf β€” same, on the list, no blurb. she's lowkey private. 🌸
  • gsl_strerror($gsl_errno) β€” This function returns a pointer to a string describing the error code gsl_errno. For example,
print ("error: gsl_strerror ($status)\n");

would print an error message like error: output range error for a status value of GSL_ERANGE. look at her go, translating error codes into actual English ✨

  • gsl_set_error_handler β€” on the list, no description in the original. yep. that's the whole bullet. πŸ™ˆ
  • gsl_set_error_handler_off() β€” This function turns off the error handler by defining an error handler which does nothing. This will cause the program to continue after any error, so the return values from any library routines must be checked. This is the recommended behavior for production programs. The previous handler is returned (so that you can restore it later).
fr fr though: if you turn the handler off and then don't check your return values, you've just built a haunted house. she said it, not me. πŸ‘‘
  • gsl_set_stream_handler β€” listed, no description in the original. the lore is withheld. πŸ’€
  • gsl_set_stream β€” also listed, also no description. keep the mystery alive. πŸ¦‹

that's the whole page, babe. errors handled, mentally and literally. 🌈

shoutout to the original though β€” this one ships as perl v5.42.3, dated 2026-08-20, and lives at Math::GSL::Errno(3pm). mwah, iconic, no notes. πŸ’œ

πŸ“¦ where this page comes from