Learn R Programming

astrolibR (version 0.1)

sixty: Convert a decimal number to sexigesimal

Description

Convert a decimal number to sexigesimal

Usage

sixty(scalar, trailsign = F)

Arguments

scalar
decimal quantity, scalar
trailsign
if =TRUE, then the function returns a negative sign to the first element, even if it is zero. If = FALSE, then the function returns a negative sign in the first nonzero element. (default = FALSE)

Value

result
real vector of three elements, sexigesimal equivalent of input decimal quantity

Details

Reverse of the function ten.

Examples

Run this code
sixty(136.127)
sixty(-0.345)  #  returns (0.0,-20.0,42.0)
sixty(-0.345, trailsign=TRUE)  #  returns (-0.0,20.0,42.0)

Run the code above in your browser using DataLab