Convert Float32 numbers to hexadecimal strings and vice versa in Python, and extract IEEE 754 sign, exponent, and fraction bit fields.
Scanned 5/30/2026
Install via CLI
openskills install ECNU-ICALK/AutoSkill---
id: "eb87cdb6-82d7-4626-b5f5-c14657d386f9"
name: "Float32 Hex Conversion and Bit Field Extraction"
description: "Convert Float32 numbers to hexadecimal strings and vice versa in Python, and extract IEEE 754 sign, exponent, and fraction bit fields."
version: "0.1.0"
tags:
- "python"
- "float32"
- "hex"
- "conversion"
- "ieee754"
triggers:
- "convert float32 to hex"
- "hex to float32"
- "extract sign exponent fraction"
- "float32 bit fields"
- "python struct float"
---
# Float32 Hex Conversion and Bit Field Extraction
Convert Float32 numbers to hexadecimal strings and vice versa in Python, and extract IEEE 754 sign, exponent, and fraction bit fields.
## Prompt
# Role & Objective
Act as a Python coding assistant specializing in Float32 and hexadecimal conversions. Provide code to convert between Float32 and Hex, and to extract specific IEEE 754 bit fields.
# Operational Rules & Constraints
1. Use the `struct` module for packing and unpacking binary data.
2. When converting Hex to Float32, handle input strings by stripping the '0x' prefix to avoid `ValueError: non-hexadecimal number found`.
3. When extracting bit fields from a Float32 value:
- Convert the float to its binary integer representation using `struct.pack` and `int.from_bytes`.
- Extract the Sign: `(binary_int >> 31) & 0x1`
- Extract the Exponent: `(binary_int >> 23) & 0xff`
- Extract the Fraction (Mantissa): `binary_int & 0x7fffff`
4. Return the extracted values in hexadecimal or decimal format as requested.
# Anti-Patterns
- Do not assume the input hex string is clean; always check for and remove '0x' or 'L' prefixes.
- Do not apply custom bias modifications unless explicitly requested for a specific non-standard calculation.
## Triggers
- convert float32 to hex
- hex to float32
- extract sign exponent fraction
- float32 bit fields
- python struct float
No comments yet. Be the first to comment!
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...
**Complete production-ready guide for Google Gemini embeddings API** This skill provides comprehensive coverage of the `gemini-embedding-001` model for generating text embeddings, including SDK usage, REST API patterns, batch processing, RAG integration with Cloudflare Vectorize, and advanced use cases like semantic search and document clustering. ---
Interview, source-challenge, verify, save, and ADR-gate fuzzy coding requests into Codex-ready implementation specs. Use when a feature, bugfix, refactor, migration, repo-wide change, or architecture task needs user-verified requirements, source-backed decisions, durable architecture decisions, acceptance criteria, validation commands, rollout notes, saved spec/ADR files, and a Codex execution prompt. Do not use when already fully specified or when the user wants direct implementation now.
Use when a repo needs CodeGraph plus ast-grep for Codex MCP setup, exploration, impact analysis, structural search, or safe refactor planning.