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 (likeEDOMin 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 (likeERANGEin 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 (likeEINVALin the C library). Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function (likeEINVALin 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 (likeENOMEMin the C library). This error is reported when a GSL routine encounters problems when trying to allocate memory withmalloc.$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 codegsl_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
- ubuntu stonking: libmath-gsl-perl 0.49-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms