MCPcopy Create free account
hub / github.com/TankHQ/tank / write_value_f64

Method write_value_f64

tank-sqlite/src/sql_writer.rs:127–141  ·  view source on GitHub ↗
(&self, context: &mut Context, out: &mut DynQuery, value: f64)

Source from the content-addressed store, hash-verified

125 fn write_value_f64(&self, context: &mut Context, out: &mut AnyQuery, value: f64) {
126 if value.is_infinite() {
127 if value.is_sign_negative() {
128 out.push('-');
129 }
130 out.push_str("1.0e+10000");
131 return;
132 }
133 if value.is_nan() {
134 log::warn!("SQLite does not support float NaN values, will write NULL instead");
135 self.write_null(context, out);
136 return;
137 }
138 GenericSqlWriter::new().write_value_f64(context, out, value);
139 }
140
141 fn write_blob(&self, _context: &mut Context, out: &mut AnyQuery, value: &[u8]) {
142 const HEX: &[u8; 16] = b"0123456789ABCDEF";
143 out.buffer().reserve(2 * value.len() + 3);
144 out.push_str("X'");

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
push_strMethod · 0.80
write_nullMethod · 0.45

Tested by

no test coverage detected