Temperature compare
temperature-compare · version 1.0.0 · Units & sizes · free, no key needed
Compare two temperatures in C, F, or K by converting both to Kelvin rationals.
Use when you need to: temperature compare · compare temperatures across units · order celsius fahrenheit kelvin.
Supported
- temperature compare
- compare temperatures across units
- order celsius fahrenheit kelvin
Not supported
- average temperatures
- sort a temperature list
- Rankine
- IEEE-754 floats
Behavior
- left and right are objects with a canonical decimal value and a unit of C, F, or K.
- Both readings are converted to Kelvin with K = C + 5463/20 and F = C * 9/5 + 32.
- Temperatures below absolute zero (K < 0) are rejected.
- cmp is -1, 0, or 1 for left <, =, or > right after the Kelvin conversion.
Input
left(object, required)right(object, required)
Output
cmp(one of -1, 0, 1, required)
Limits
- max digits before point: 20
- max fractional digits: 10
Example
Request input:
{
"left": {
"value": "0",
"unit": "C"
},
"right": {
"value": "32",
"unit": "F"
}
}
Response:
{
"result": {
"cmp": 0
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "temperature-compare",
"version": "1.0.0",
"input": {
"left": {
"value": "0",
"unit": "C"
},
"right": {
"value": "32",
"unit": "F"
}
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/temperature-compare/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"left":{"value":"0","unit":"C"},"right":{"value":"32","unit":"F"}}'
The machine-readable contract is at /v1/tools/temperature-compare/versions/1.0.0.
CLI
node cli.mjs run temperature-compare 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Temperature convert: Convert a decimal temperature between Celsius, Fahrenheit, and Kelvin as an exact rational.
- Byte size compare: Compare two non-negative integer byte sizes by exact byte amounts.
- Byte size convert: Convert a non-negative integer byte size between IEC binary units as an exact rational.
- Length compare: Compare two integer length measurements by exact nanometer amounts.
- Length convert: Convert a canonical integer length between exact SI and international customary units.
- Mass add: Add mixed-unit canonical integer mass amounts and express the sum in a target unit as a reduced rational.