Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

MTH$ – MATH Routines

Overview

VX/MTH$ is a call-compatible re-implementation of the OpenVMS MTH$ mathematics run-time library for x86 and ARM Linux. It provides the MTH$ entry points that DEC and VSI applications call for trigonometry, logarithms, exponentials, square roots, min/max selection, sign handling, and floating-point conversions, so migrated programs link and run while preserving numerical behaviour. It is the runtime the compiled or translated object links against, not the compiler and not a source translator.

Every routine is a thin wrapper over the host platform's IEEE-754 math implementation, exposed under the original VMS call names so a program written against VAX or Alpha MTH$ compiles and links unchanged. VX/MTH$ ships inside VX/RT alongside the other OpenVMS run-time libraries such as LIB$, OTS$, STR$, and FOR$, giving OpenVMS applications that depend on MTH$ routines full mathematical functionality on Linux without source changes.

Architecture and linkage

VX/MTH$ is a link-time library, not a running service. Each routine is compiled from a thin C or C++ body over the host platform's <math.h> functions and archived into the VX runtime static library, libvxrt.a. A migrated application links that archive and calls the MTH$ entry points directly, exactly as it linked the OpenVMS mathematics run-time library before. There is no MTH$ server process, no daemon, no initialisation call, and no per-call allocation.

PropertyVX/MTH$
DeliveryObject modules archived into libvxrt.a, linked into the application.
Implementation languageC and C++ with extern "C" bodies over IEEE-754 <math.h>.
Public entry pointsThe full OpenVMS MTH$ callable API surface (see the routine table below).
Calling modelDirect in-process function calls; no runtime server, no IPC.
Target platformsx86 and ARM Linux, through the VX/RT runtime.
PrototypesShared VX headers (routine declarations, condition symbols, call-name aliases).

Component layers

MTH$ has no processes to administer. Its parts are the numeric routine bodies, the call-name aliasing layer that wires the VMS and Fortran call names to each body, a small set of shared helpers, and the condition and signal layer that reports domain errors.

LayerRole
Routine bodiesOne C or C++ body per routine, each a guarded call into the host math library.
Alias layerEmits the four VMS and Fortran call names that resolve to each routine's canonical symbol.
Radian and degree helpersShared conversion helpers used by the trigonometry-in-degrees families.
Variadic min and max workhorsesScan an array of operands and return the extremum for the MAX and MIN families.
Condition and signal layerRaises VMS-style conditions for domain errors through the LIB$ signal path.

Naming, linkage and calling conventions

Every routine is exposed under four equivalent call names, so existing object references and source in any supported language resolve without change. Each source body defines one canonical C symbol of the form MTH_D_<NAME>; an alias macro then wires the uppercase VMS dollar-sign name, its lowercase spelling, and both trailing-underscore forms to that single body.

Name formExampleUsed by
VMS dollar-sign nameMTH$DSQRTRecompiled OpenVMS object code and assembler references.
Lowercase aliasmth$dsqrtCase-sensitive toolchains and mixed-case source.
Trailing-underscore formsmth$dsqrt_, MTH$DSQRT_The gfortran and g77 Fortran ABI entry points.
Canonical C symbolMTH_D_DSQRTThe one body all four aliases resolve to.

Because MTH$ arguments are scalars passed by reference, the C and Fortran-77 call paths are identical: a Fortran Y = DSQRT(X) resolves to dsqrt_, which is just another alias of the same routine, with no separate Fortran thunk needed.

Argument-passing rules

RuleDetail
Arguments by referenceAll arguments are passed as pointer-to-value, following the VAX convention.
Scalar result by valueMost routines return their numeric result directly by value.
H family output pointerThe H (h-float) family instead takes a leading output pointer and returns void.
Variadic min and maxThe MAX and MIN families take a leading count argument equal to the operand count minus one.
IEEE double internallyAll computation is performed in IEEE double; the historical VAX float formats collapse to one representation.
One representation, many entry points. The D, G, and H entry-point families exist for source compatibility. They all delegate to the same IEEE double arithmetic, so callers get consistent results across the precision variants they originally used on VAX and Alpha.

Type-prefix legend

The first letter or letters of a routine name encode the operand and result type:

PrefixType
none or Af-float, single-precision float.
Dd-float, double-precision double.
Gg-float, mapped to double (same body as the D form).
Hh-float, result returned through a leading output pointer.
I or J16-bit and 32-bit signed integer.
II or JI16-bit and 32-bit integer for the bitwise and integer families.

A routine body

Routine bodies are plain extern "C" functions that dereference their arguments, guard the domain where required, and call the host math library. Double square root, which signals on a negative operand, is representative:

extern "C" double MTH_D_DSQRT(double *d) {
    if (*d < 0) LIB_D_SIGNAL(MTH_s_SQUROONEG);   /* sqrt of negative */
    return sqrt(*d);
}
__AliasF(MTH_D_DSQRT, MTH$DSQRT, mth$dsqrt);         /* wires all four call names */

Calling a routine

A migrated program links against libvxrt.a and calls the MTH$ entry points directly, passing arguments by reference. The by-value return, the h-float output pointer, and the leading count on the variadic routines all appear below:

/* by-value return, by-reference argument (VAX convention) */
double x = 2.0, root;
root = MTH$DSQRT(&x);              /* root = sqrt(2.0) */

/* interest factor for a statement line: e ^ rate */
double rate = 0.045, factor;
factor = MTH$DEXP(&rate);

/* h-float family: result via a leading output pointer, returns void */
double h_in = 2.0, h_out;
MTH$HABS(&h_out, &h_in);           /* h_out = 2.0 */

/* variadic max: leading n = (operand count - 1), reads d plus n more */
double a = 1.0, b = 9.0, c = 4.0, largest;
largest = MTH$DMAX1(2, &a, &b, &c);  /* n = 2, three operands, result 9.0 */

Routine families

The MTH$ library groups its routines by mathematical function. Within each group the per-prefix variants (single-precision, double-precision, g-float and h-float, and the integer forms) share one underlying body. The table names each group and a representative sample; the complete list follows in the next section.

GroupWhat it coversRepresentative routines
Absolute value and signMagnitude, sign transfer, and sign extraction.MTH$ABS, MTH$DABS, MTH$SIGN, MTH$DSIGN, MTH$SGN
Exponential and logarithmExponentials and natural, base-10, and base-2 logarithms.MTH$EXP, MTH$DEXP, MTH$ALOG, MTH$DLOG10, MTH$DLOG2
Square rootSquare root across the precision variants, guarded for negative operands.MTH$SQRT, MTH$DSQRT, MTH$GSQRT, MTH$HSQRT
Trigonometry in radiansSine, cosine, and tangent and their combined and inverse forms.MTH$SIN, MTH$COS, MTH$TAN, MTH$DSIN, MTH$SINCOS
Trigonometry in degreesDegree variants of the trigonometric and inverse trigonometric routines.MTH$SIND, MTH$COSD, MTH$TAND, MTH$ASIND, MTH$ATAND
Inverse trigonometryArc sine, arc cosine, and arc tangent, including the two-argument arc tangent.MTH$ASIN, MTH$ACOS, MTH$ATAN, MTH$ATAN2, MTH$DATAN2
HyperbolicHyperbolic sine, cosine, and tangent across the precision variants.MTH$SINH, MTH$COSH, MTH$TANH, MTH$DSINH, MTH$DTANH
Rounding and truncationTruncate toward zero, round to nearest, floor, and positive difference.MTH$AINT, MTH$DINT, MTH$ANINT, MTH$FLOOR, MTH$DIM
Modulus and productFloating and integer modulus and double-precision product.MTH$AMOD, MTH$DMOD, MTH$DPROD, MTH$GPROD
Minimum and maximumVariadic selection of the least or greatest of a list of operands.MTH$AMAX1, MTH$DMAX1, MTH$IMIN0, MTH$UMAX, MTH$UMIN
Precision and type conversionSingle to double casts, double to single, and integer to floating conversions.MTH$DBLE, MTH$SNGL, MTH$FLOATI, MTH$DFLOTJ, MTH$CVT_G_D
Float to integer conversionTruncating and rounding conversions from floating values to 16-bit and 32-bit integers.MTH$IIFIX, MTH$JINT, MTH$ININT, MTH$JNINT
Integer and bitwiseInteger absolute, sign, and difference, plus bitwise AND, OR, XOR, NOT, and shift.MTH$IIABS, MTH$IIAND, MTH$IIOR, MTH$IIEOR, MTH$IISHFT
RandomPseudo-random number generation.MTH$RANDOM

VX/MTH$ callable routines

The full set of callable MTH$ routines, spanning trigonometry, logarithms, exponentials, square roots, minimum and maximum selection, sign and rounding functions, integer and bitwise operations, and floating-point conversions. Each is available under its VMS dollar-sign name as well as the portable C and Fortran-callable aliases described above.

MTH$ APIFunction
MTH$ABSAbsolute value of a number
MTH$ACOSArc cosine function
MTH$ACOSDArc cosine in degrees
MTH$AIMAX0Integer maximum of values
MTH$AIMIN0Integer minimum of values
MTH$AINTTruncate to integer
MTH$AJMAX0Integer max (adjustable)
MTH$AJMIN0Integer min (adjustable)
MTH$ALOGNatural logarithm
MTH$ALOG10Base-10 logarithm
MTH$ALOG2Base-2 logarithm
MTH$AMAX1Maximum of floating values
MTH$AMIN1Minimum of floating values
MTH$AMODModulus function
MTH$ANINTNearest integer function
MTH$ASINArc sine function
MTH$ASINDArc sine in degrees
MTH$ATANArc tangent function
MTH$ATAN2Arc tangent of two args
MTH$ATANDArc tangent in degrees
MTH$ATAND2Arc tangent of two args, in degrees
MTH$ATANHInverse hyperbolic tangent
MTH$COSCosine function
MTH$COSDCosine in degrees
MTH$COSHHyperbolic cosine
MTH$CVT_D_GConvert double to G format
MTH$CVT_G_DConvert G format to double
MTH$DABSDouble precision absolute
MTH$DACOSDouble arc cosine
MTH$DACOSDDouble arc cosine in degrees
MTH$DASINDouble arc sine
MTH$DASINDDouble arc sine in degrees
MTH$DATANDouble arc tangent
MTH$DATAN2Double arc tangent (2 args)
MTH$DATANDDouble arc tangent in degrees
MTH$DATAND2Double atan2 in degrees
MTH$DATANHDouble inverse hyperbolic tangent
MTH$DBLEConvert integer to double
MTH$DCOSDouble cosine
MTH$DCOSDComputes the cosine of an angle in degrees
MTH$DCOSHDouble hyperbolic cosine
MTH$DDIMDouble positive difference
MTH$DEXPDouble exponential function
MTH$DFLOORFloor function for double
MTH$DFLOTIConvert integer to float
MTH$DFLOTJConvert integer to float
MTH$DIMPositive difference function
MTH$DINTDouble integer truncation
MTH$DLOGDouble natural logarithm
MTH$DLOG10Double base-10 logarithm
MTH$DLOG2Double base-2 logarithm
MTH$DMAX1Double maximum value
MTH$DMIN1Double minimum value
MTH$DMODDouble modulus function
MTH$DNINTNearest integer (double)
MTH$DPRODDouble precision product
MTH$DSIGNDouble sign function
MTH$DSINDouble sine function
MTH$DSINCOSDouble sine and cosine
MTH$DSINCOSDDouble sin/cos in degrees
MTH$DSINDDouble sine in degrees
MTH$DSINHDouble hyperbolic sine
MTH$DSQRTDouble square root
MTH$DTANDouble tangent function
MTH$DTANDDouble tangent in degrees
MTH$DTANHDouble hyperbolic tangent
MTH$EXPExponential function
MTH$FLOATIConvert integer to float
MTH$FLOATJConvert integer to float
MTH$FLOORFloor function
MTH$GABSGeneral absolute value
MTH$GACOSGeneral arc cosine
MTH$GACOSDGeneral arc cosine in degrees
MTH$GASINGeneral arc sine
MTH$GASINDGeneral arc sine in degrees
MTH$GATANGeneral arc tangent
MTH$GATAN2General arc tangent (2 args)
MTH$GATANDGeneral arc tangent in degrees
MTH$GATAND2General atan2 in degrees
MTH$GATANHComputes the inverse hyperbolic tangent
MTH$GCOSGeneral cosine function
MTH$GCOSDGeneral cosine in degrees
MTH$GCOSHGeneral hyperbolic cosine
MTH$GDBLEGeneral double precision
MTH$GDIMGeneral positive difference
MTH$GEXPGeneral exponential function
MTH$GFLOORGeneral floor function
MTH$GFLOTIGeneral integer to float
MTH$GFLOTJGeneral integer to float
MTH$GINTGeneral integer truncation
MTH$GLOGGeneral natural logarithm
MTH$GLOG10General base-10 logarithm
MTH$GLOG2General base-2 logarithm
MTH$GMAX1General maximum value
MTH$GMIN1General minimum value
MTH$GMODGeneral modulus function
MTH$GNINTGeneral nearest integer
MTH$GPRODGeneral precision product
MTH$GSIGNGeneral sign function
MTH$GSINGeneral sine function
MTH$GSINCOSGeneral sine and cosine
MTH$GSINCOSDGeneral sin/cos in degrees
MTH$GSINDGeneral sine in degrees
MTH$GSINHGeneral hyperbolic sine
MTH$GSQRTGeneral square root
MTH$GTANGeneral tangent function
MTH$GTANDGeneral tangent in degrees
MTH$GTANHGeneral hyperbolic tangent
MTH$HABSHyperbolic absolute value
MTH$HACOSHyperbolic arc cosine
MTH$HACOSDHyperbolic arc cosine in degrees
MTH$HASINHyperbolic arc sine
MTH$HASINDHyperbolic arc sine in degrees
MTH$HATANHyperbolic arc tangent
MTH$HATAN2Hyperbolic arc tangent (2 args)
MTH$HATANDHyperbolic arc tangent in degrees
MTH$HATAND2Hyperbolic atan2 in degrees
MTH$HATANHInverse hyperbolic tangent
MTH$HCOSHyperbolic cosine function
MTH$HCOSDComputes the hyperbolic cosine in degrees
MTH$HCOSHHyperbolic cosine
MTH$HDBLEHyperbolic double precision
MTH$HDIMHyperbolic positive difference
MTH$HEXPHyperbolic exponential function
MTH$HFLOORHyperbolic floor function
MTH$HFLOTIHyperbolic integer to float
MTH$HFLOTJHyperbolic integer to float
MTH$HINTHyperbolic integer truncation
MTH$HLOGHyperbolic natural logarithm
MTH$HLOG10Hyperbolic base-10 logarithm
MTH$HLOG2Hyperbolic base-2 logarithm
MTH$HMAX1Hyperbolic maximum value
MTH$HMIN1Hyperbolic minimum value
MTH$HMODHyperbolic modulus function
MTH$HNINTHyperbolic nearest integer
MTH$HPRODHyperbolic precision product
MTH$HSIGNHyperbolic sign function
MTH$HSINHyperbolic sine function
MTH$HSINCOSHyperbolic sine and cosine
MTH$HSINCOSDHyperbolic sin/cos in degrees
MTH$HSINDHyperbolic sine in degrees
MTH$HSINHHyperbolic sine
MTH$HSQRTHyperbolic square root
MTH$HTANHyperbolic tangent function
MTH$HTANDHyperbolic tangent in degrees
MTH$HTANHHyperbolic tangent
MTH$IIABSInteger absolute value
MTH$IIANDInteger bitwise AND
MTH$IIDIMInteger positive difference
MTH$IIDINTInteger double precision
MTH$IIDNNTInteger nearest value
MTH$IIEORInteger bitwise XOR
MTH$IIFIXInteger fixed point conversion
MTH$IIGINTInteger general integer
MTH$IIGNNTInteger general nearest integer
MTH$IIHINTInteger hyperbolic integer
MTH$IIHNNTInteger hyperbolic nearest int
MTH$IINTInteger conversion function
MTH$IIORPerforms a bitwise OR operation
MTH$IISHFTInteger bit shift function
MTH$IISIGNInteger sign function
MTH$IMAX0Integer maximum (0-based)
MTH$IMAX1Integer maximum (1-based)
MTH$IMIN0Integer minimum (0-based)
MTH$IMIN1Integer minimum (1-based)
MTH$IMODInteger modulus function
MTH$ININTInteger nearest integer
MTH$INOTInteger bitwise NOT
MTH$JIABSGeneral integer absolute
MTH$JIANDGeneral integer bitwise AND
MTH$JIDIMGeneral integer positive difference
MTH$JIDINTGeneral integer double precision
MTH$JIDNNTGeneral integer nearest int
MTH$JIEORGeneral integer bitwise XOR
MTH$JIFIXGeneral integer fixed point
MTH$JIGINTGeneral integer general int
MTH$JIGNNTGeneral integer nearest int
MTH$JIHINTGeneral integer hyperbolic int
MTH$JIHNNTGeneral int hyperbolic nearest
MTH$JINTGeneral integer conversion
MTH$JIORGeneral integer bitwise OR
MTH$JISHFTGeneral integer bit shift
MTH$JISIGNGeneral integer sign function
MTH$JMAX0General integer max (0-based)
MTH$JMAX1General integer max (1-based)
MTH$JMIN0General integer min (0-based)
MTH$JMIN1General integer min (1-based)
MTH$JMODGeneral integer modulus
MTH$JNINTGeneral integer nearest int
MTH$JNOTGeneral integer bitwise NOT
MTH$RANDOMGenerate a random number
MTH$SGNSign function
MTH$SGNEXTExtended sign function
MTH$SIGNReturn sign of a number
MTH$SINSine function
MTH$SINCOSSine and cosine functions
MTH$SINCOSDSine and cosine in degrees
MTH$SINDSine function in degrees
MTH$SINHComputes the hyperbolic sine function
MTH$SNGLConverts a double-precision floating point to single
MTH$SNGLGConverts a generalized floating point to single
MTH$SQRTComputes the square root of a number
MTH$TANComputes the tangent of an angle
MTH$TANDComputes the tangent of an angle in degrees
MTH$TANHComputes the hyperbolic tangent
MTH$UMAXReturns the maximum of two unsigned numbers
MTH$UMINReturns the minimum of two unsigned numbers

Status and signal model

Math routines do not return status codes the way file or string routines do. A routine either returns its numeric result directly, or, for the handful of status-bearing routines, returns SS$_NORMAL (the value 1). Domain errors such as the square root of a negative number or the logarithm of zero are reported as VMS-style conditions, raised through the LIB$ signal path so an established condition handler can catch them exactly as it did on OpenVMS.

Condition symbolValueMeaningRaised by
SS$_NORMAL1Success.Status-bearing routines.
MTH_s_INVARGMAT1475212Invalid argument, for example arc cosine of a value outside minus one to one.DACOS, DASIN, DATAN2, the ATANH forms.
MTH_s_LOGZERNEG1475228Logarithm of zero or a negative value.DLOG, DLOG10, DLOG2.
MTH_s_SQUROONEG1475236Square root of a negative value.DSQRT.
MTH_s_FLOOVEMAT1475268Floating overflow.DEXP, DTAN, the hyperbolic forms, DMOD.
MTH_s_FLOUNDMAT1475276Floating underflow (gated, see below).DEXP, DTAND, DSIND.

Domain-guarded routines

Only the routines with a defined domain restriction test their operands and signal. Square root guards against negatives, the logarithms guard against zero and negatives, the inverse trigonometric routines guard their input range, and the exponential, tangent, hyperbolic, and modulus routines guard against overflow. Every other routine returns its result without a condition.

Underflow reporting is gated. The floating-underflow condition is raised only when the runtime configuration option VX_UNDERFLOW_ENABLE is set. Unless it is enabled, an underflow is treated as a quiet zero rather than a signalled condition, so applications that previously depended on an underflow signal should set the option during migration testing.

Porting notes and behavioural differences

VX/MTH$ preserves OpenVMS computation behaviour for the overwhelming majority of routines, so applications that rely on MTH$ services migrate without rewriting the mathematical code. A small number of routines have documented behavioural differences from the VAX and Alpha originals, listed here so a porting team can account for them during testing rather than discover them in production.

AreaBehaviour to check
Forward trigonometry in degreesThe forward degree-input routines (SIND, COSD, TAND and their precision variants) diverge from the OpenVMS result and should be verified before an application relies on them. The inverse degree routines (ASIND, ACOSD, ATAND) match OpenVMS.
Truncation input mutationDINT (and GINT and HINT, which call it) can modify the caller's input value for negative operands. Pass a copy if the original value is needed after the call. AINT is unaffected.
Integer bit shift directionIISHFT and JISHFT interpret the sign of the shift count opposite to the Fortran ISHFT convention. Negate the shift count when porting code that assumed the Fortran direction.
Nearest-integer rounding at the half boundaryDNINT rounds a negative value ending in .5 toward positive infinity rather than away from zero, so DNINT(-2.5) yields -2.0. Confirm rounding-sensitive financial calculations.
Double modulusDMOD uses a custom remainder rather than the host library, and its overflow and underflow detection is less reliable for negative divisors. Check results where the divisor can be negative.
Pseudo-random qualityMTH$RANDOM is a low-quality generator suitable only for compatibility, not for statistical or cryptographic use. Replace it where distribution quality matters.
Hardware exception trappingThe SIGFPE trapping path is not enabled, so a hardware floating overflow yields a large value or NaN rather than a VMS condition, except in the routines that explicitly test for it. Applications that relied on trapped exceptions should validate their error paths.
No reserved-operand or null-pointer checksReserved and subnormal operands pass through as ordinary IEEE values, and a null argument pointer is not checked. Validate pointers before the call as you would in any C interface.
Extended-precision rangeThe h-float family delegates to IEEE double, so code that depended on the original h-float range or extra precision will see standard double behaviour. Review any calculation that relied on the wider VAX h-float format.
Migration sizing. When scoping a port, check your application's actual MTH$ call inventory against this list. A small number of rarely used entry points are declared but prioritised on demand; Sector7 completes them as migrations require them, so flag any dependency during the porting assessment.

Quick reference

Key facts

ItemValue
Public entry pointsThe full OpenVMS MTH$ callable API surface
DeliveryLinked into the application via libvxrt.a, inside VX/RT
Platformsx86 and ARM Linux
Internal arithmeticIEEE-754 double for all precision families
Argument passingAll arguments by reference; result by value, except the h-float family
Variadic min and maxLeading count argument equal to operand count minus one
Domain errorsRaised as VMS conditions through the LIB$ signal path

Call-name forms per routine

MTH$DSQRT
mth$dsqrt
MTH$DSQRT_
mth$dsqrt_

Trigonometry routines

MTH$SIN
MTH$COS
MTH$TAN
MTH$SIND
MTH$COSD
MTH$TAND
MTH$ASIN
MTH$ACOS
MTH$ATAN
MTH$ATAN2
MTH$SINCOS
MTH$DSIN

Exponential, logarithm and root routines

MTH$EXP
MTH$DEXP
MTH$ALOG
MTH$DLOG
MTH$ALOG10
MTH$DLOG10
MTH$ALOG2
MTH$DLOG2
MTH$SQRT
MTH$DSQRT
MTH$GSQRT
MTH$HSQRT

Hyperbolic routines

MTH$SINH
MTH$COSH
MTH$TANH
MTH$DSINH
MTH$DCOSH
MTH$DTANH
MTH$HSINH
MTH$HTANH

Minimum, maximum and sign routines

MTH$AMAX1
MTH$AMIN1
MTH$DMAX1
MTH$DMIN1
MTH$IMAX0
MTH$IMIN0
MTH$UMAX
MTH$UMIN
MTH$SIGN
MTH$DSIGN
MTH$SGN
MTH$DABS

Integer and bitwise routines

MTH$IIABS
MTH$IIAND
MTH$IIOR
MTH$IIEOR
MTH$INOT
MTH$IISHFT
MTH$IISIGN
MTH$IIDIM

Conversion routines

MTH$DBLE
MTH$SNGL
MTH$SNGLG
MTH$FLOATI
MTH$FLOATJ
MTH$DFLOTI
MTH$DFLOTJ
MTH$CVT_G_D

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

What is VX/MTH$ and how does it help with OpenVMS migration?

VX/MTH$ provides a call-compatible implementation of OpenVMS mathematical functions for x86 and ARM Linux environments. It ensures precision and compatibility for OpenVMS applications performing mathematical computations, enabling seamless execution on Linux without requiring major code modifications.

This compatibility layer eliminates the need to rewrite mathematical logic during migration, preserving your existing computational workflows. For guidance on planning your OpenVMS modernization strategy, contact our migration specialists.

What mathematical functions does VX/MTH$ support?

VX/MTH$ supports a comprehensive set of mathematical functions including trigonometry, logarithms, floating-point conversions, hyperbolic functions, and bitwise operations.

How many MTH$ API functions are available in VX/MTH$?

VX/MTH$ provides over 180 callable routines that mirror the complete OpenVMS MTH$ API set.

Does VX/MTH$ maintain numerical precision from OpenVMS?

Yes, VX/MTH$ ensures numerical precision and maintains OpenVMS computation behavior exactly as it functioned on the original platform.

What types of mathematical operations are included?

VX/MTH$ includes basic arithmetic, trigonometric functions (sin, cos, tan), logarithmic operations, exponential functions, and specialized routines for integer operations and floating-point conversions.

Can existing OpenVMS code using MTH$ functions run without changes?

Yes, VX/MTH$ allows seamless migration of OpenVMS applications that rely on MTH$ routines without requiring major code modifications. The API maintains full compatibility with original OpenVMS function calls and return values.

What are the main benefits of using VX/MTH$ for migration?

VX/MTH$ preserves OpenVMS mathematical computation logic, enabling direct porting of applications while maintaining numerical precision on Linux. This approach eliminates vendor lock-in and reduces infrastructure costs while preserving productivity.

The solution minimizes development costs by avoiding the need to rewrite mathematical components. Companies like Ford have achieved significant cost savings through similar modernization strategies.

To explore how VX/MTH$ can streamline your OpenVMS migration project, contact our technical team.

Which CPU architectures and operating systems does VX/MTH$ run on?

VX/MTH$ provides its call-compatible OpenVMS math functions on x86 and ARM Linux. It lets OpenVMS applications that perform mathematical computations execute on those Linux environments while preserving the original OpenVMS behaviour.

How many MTH$ routines does VX/MTH$ implement, and what kinds?

VX/MTH$ provides 207 callable MTH$ routines covering trigonometry (sine, cosine, tangent and their inverses, in radians and degrees), logarithms (natural, base-10, base-2), exponentials, floating-point conversions, minimum and maximum selection, sign and truncation functions, and integer bitwise operations.

Does VX/MTH$ support double-precision and hyperbolic variants?

Yes. Alongside the single-precision routines, the set includes the double-precision MTH$D family (for example MTH$DSQRT, MTH$DEXP, MTH$DATAN2) and the hyperbolic MTH$H family (for example MTH$HSINH, MTH$HTANH, MTH$HACOS), matching the OpenVMS MTH$ API.

Are trigonometric functions available in degrees as well as radians?

Yes. In addition to the radian forms, VX/MTH$ provides degree variants such as MTH$SIND, MTH$COSD, MTH$TAND, MTH$ASIND, MTH$ACOSD, and MTH$ATAND for angle inputs and results expressed in degrees.

Does VX/MTH$ include integer and bitwise routines, not just floating point?

Yes. The routine set includes integer operations and bitwise functions, for example MTH$IIAND (AND), MTH$IIOR and MTH$IIEOR (OR and XOR), MTH$INOT (NOT), and MTH$IISHFT (bit shift), plus integer minimum and maximum, absolute value, and sign functions.

Do I have to modify my application code to use VX/MTH$?

No major modifications are required. VX/MTH$ is fully compatible with the OpenVMS MTH$ APIs and maintains OpenVMS computation behaviour, so applications that rely on MTH$ routines can be migrated while preserving numerical precision.

How does VX/MTH$ fit with the rest of the Sector7 migration stack?

VX/MTH$ integrates with VX/RT to provide full OpenVMS mathematical functionality on x86 and ARM Linux, so MTH$-based math works as part of the broader VX/RT runtime environment during and after migration.

How is VX/MTH$ called from Fortran and C code?

Each routine is exposed under four call names (MTH$xxxx, mth$xxxx, and both with a trailing underscore), and all arguments are passed by reference, so translated Fortran and C callers reach the same routine bodies without source changes. The trailing-underscore forms are the Fortran ABI entry points.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.