mathtools.numbers
Module mathtools.numbers
API
ballerinax/mathtools.numbers Ballerina library
Overview
This is a generated connector for Numbers API v1.5 OpenAPI specification.
Numbers API of Math Tools provides the capability to access the operations that are all about numbers
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create a math tools account.
- Obtaining tokens
- Obtain your token by following this link.
Clients
mathtools.numbers: Client
This is a generated connector for Numbers API v1.5 OpenAPI specification.
Numbers API of Math Tools provides the capability to access the operations that are all about numbers
Constructor
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create an Math tools account and obtain tokens following this guide.
init (ApiKeysConfig apiKeyConfig, ConnectionConfig config, string serviceUrl)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.math.tools" - URL of the target service
getNumberOfTheDay
function getNumberOfTheDay() returns json|error
Get the number of the day for current day
Return Type
- json|error - 200 Success response
getRandomFactNumber
Get a random fact about a number
Parameters
- number int - Number value
Return Type
- json|error - 200 Success response
generateRandomNumbers
Generate random number(s)
Parameters
- min int? (default ()) - Minimum Number value in the range
- max int? (default ()) - Maximum Number value
- total int? (default ()) - Total number of random numbers to generate. Defaults to 1
Return Type
- json|error - 200 Success response
getOrdinalOfNumber
Get the ordinal of the given number
Parameters
- number int? (default ()) - Number value
Return Type
- json|error - 200 Success response
getCardinalOfNumber
Get the cardinal of the given number
Return Type
- json|error - 200 Success response
spellNumberAsCurrency
Spells out the number as a currency
Return Type
- json|error - 200 Success response
convertBase10ToEgyptianNumeral
Convert base 10 representation of a given number to egyptian numeral.
Parameters
- number int? (default ()) - Number to convert
Return Type
- json|error - 200 Success response
convertBase10ToChineseNumeral
Convert base 10 representation of a given number to chinese numeral.
Parameters
- number int? (default ()) - Number to convert
Return Type
- json|error - 200 Success response
convertBase10ToRomanNumeral
Convert base 10 representation of a given number to roman numeral.
Parameters
- number int? (default ()) - Number to convert
Return Type
- json|error - 200 Success response
convertGivenNumberToBinary
Convert a given number to binary
Parameters
- number int - Number to convert to binary
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
Return Type
- json|error - 200 success response
convertGivenNumberToOctal
Convert a given number to octal
Parameters
- number int - Number to convert to octal
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
Return Type
- json|error - 200 success response
convertToHexadecimal
Convert a given number to hexadecimal
Parameters
- number int - Number to convert to hex
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
Return Type
- json|error - 200 success response
convertBase
Convert a given number from one base to another base
Parameters
- number int - Number to convert to the target base
- to int - Target base to convert to
- 'from int? (default ()) - Base of the supplied number (Optional base 10 assumed by default)
Return Type
- json|error - 200 success response
getDigitsOfPI
Get digits of pi (Ã,€)
Parameters
- 'from int? (default ()) - Optional start position
- to int? (default ()) - Optional start position
Return Type
- json|error - 200 Success response
checkNumberIsPrime
Checks whether a given number is a known prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsMersennePrime
Checks whether a given number is a known mersenne prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsFermatPrice
Checks whether a given number is a known fermat prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsKnownPellPrime
Checks whether a given number is a known pell prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsKnownPartitionPrime
Checks whether a given number is a known partition prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsKnownFibonacciPrime
Checks whether a given number is a known fibonacci prime number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
getPrimeFactors
Get the prime factors of a given number.
Parameters
- number int? (default ()) - Number to get the factors
Return Type
- json|error - 200 Success response
checkNumberIsPalindrome
Checks whether a given number is a palindrome number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsTriangle
Checks whether a given number is a triangle number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsCube
Checks whether a given number is a cube number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
checkNumberIsSquare
Checks whether a given number is a square number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
getNumberIsPerfect
Checks whether a given number is a perfect number or not.
Parameters
- number int? (default ()) - Number to check
Return Type
- json|error - 200 Success response
Records
mathtools.numbers: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- xMathtoolsApiSecret string - Represents API Key
X-Mathtools-Api-Secret
mathtools.numbers: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
mathtools.numbers: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
mathtools.numbers: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
Import
import ballerinax/mathtools.numbers;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 5
Current verison: 2
Weekly downloads
Keywords
Education/eLearning
Cost/Freemium
Contributors
Dependencies