ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_freestanding_math.c File Reference

Project-owned freestanding integer math primitive (abs). More...

#include "ra8_freestanding.h"
Include dependency graph for ra8_freestanding_math.c:

Go to the source code of this file.

Functions

int abs (int j)
 Compute absolute value of integer.

Detailed Description

Project-owned freestanding integer math primitive (abs).

Tag
[Ring 0 / Foundation] {World: Dual}

Standard ISO C integer absolute value primitives implemented directly for target firmware without libc or newlib dependencies.

Since
0.1.0

Definition in file ra8_freestanding_math.c.

Function Documentation

◆ abs()

int abs ( int j)

Compute absolute value of integer.

Returns the non-negative magnitude of j.

Parameters
[in]jSigned integer value.
Returns
Absolute value of j.
Return values
valueNon-negative integer.
Precondition
j is not INT_MIN.
Standard two's complement integer environment.
Postcondition
Returned value is non-negative.
Input j is unmodified.
Note
Pure arithmetic function; never allocates; reentrant and thread-safe.
Since
0.1.0

Definition at line 34 of file ra8_freestanding_math.c.

Referenced by internal_emit_hit(), internal_emit_tag_url(), and sh_src_string().