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

Method write_value_f32

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

Source from the content-addressed store, hash-verified

109 fn write_value_f32(&self, context: &mut Context, out: &mut AnyQuery, value: f32) {
110 if value.is_infinite() {
111 if value.is_sign_negative() {
112 out.push('-');
113 }
114 out.push_str("1.0e+10000");
115 return;
116 }
117 if value.is_nan() {
118 log::warn!("SQLite does not support float NaN values, will write NULL instead");
119 self.write_null(context, out);
120 return;
121 }
122 GenericSqlWriter::new().write_value_f32(context, out, value);
123 }
124
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('-');

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
push_strMethod · 0.80
write_nullMethod · 0.45

Tested by

no test coverage detected